package com.aisile.admin.controller.v1;

import com.aisile.admin.service.AdSensitiveService;
import com.aisile.apis.admin.controller.StrategyController;
import com.aisile.model.admin.dtos.SensitiveDto;
import com.aisile.model.admin.pojos.AdSensitive;
import com.aisile.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/adSensitive")
public class AdSensitiveController implements StrategyController {

    @Autowired
    private AdSensitiveService adSensitiveService;

    @PostMapping("/pageSensitive")
    @Override
    public ResponseResult getPageList(@RequestBody SensitiveDto dto) {
        return  adSensitiveService.getPageList(dto);
    }

    @PostMapping("/save")
    @Override
    public ResponseResult addstrategy(@RequestBody AdSensitive sensitive) {
        return adSensitiveService.adsensitive(sensitive);
    }

    @PutMapping("/update")
    @Override
    public ResponseResult updatestrategy(@RequestBody AdSensitive sensitive) {
        return adSensitiveService.upsensitive(sensitive);
    }

    @GetMapping("getlist/{id}")
    @Override
    public ResponseResult getlist(@PathVariable Integer id) {
        return adSensitiveService.getlist(id);
    }

    @DeleteMapping("/deletes")
    @Override
    public ResponseResult deletesensitive(@RequestBody String[] ids) {
        return adSensitiveService.deletesensitives(ids);
    }

    @DeleteMapping("/delete/{id}")
    @Override
    public ResponseResult deletesensitive(@PathVariable Integer id) {
        return adSensitiveService.deletesensitive(id);
    }


}
